<include file="Public:header" />
<div class="subnav">
  <div class="explain-col" style="position: relative;">
    <form name="searchForm" id="searchForm" method="GET" action="">
      搜索：
      <select name="roleId" id="roleId" >
          <option value="0">所属部门</option>
          <volist name="roleList" id="vo">
            <option value="{$vo.id}"  />{$vo.name}</option>
          </volist>
      </select>
      <select name="userId" id="userId" >
          <option value="0">请选择用户</option>
          <volist name="userList" id="vo">
            <option value="{$vo.id}"  />{$vo.username}</option>
          </volist>
      </select>
      <!--开始时间：<input id="title" type="text" class="input-text Wdate" size="30" name="startTime" value="<empty name="info['create_time']"><php>echo date('Y-m-d');</php><else/>{$info.create_time|date='Y-m-d',###}</empty> " onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
      结束时间：<input id="title" type="text" class="input-text Wdate" size="30" name="endTime" value="<empty name="info['create_time']"><php>echo date('Y-m-d');</php><else/>{$info.create_time|date='Y-m-d',###}</empty> " onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />-->
      <!--<input type="text" name="keyword" size="20"  value="{$_GET['keyword']}" class="input-text" />-->
      
      <input type="submit" value=" 统计 " class="button" />
    </form>
      <!--<div class="content-menu" style="position: absolute; right: 30px;top: 5px;">
        <a href="javascript:openWinBox('__URL__/add','添加电话记录',850);" class="add fb"><em>添加电话记录</em></a>
      </div>-->
  </div>
</div>
<!--subnav-->


<div class="pad-lr-10">
  <form name="myform" id="myform" action="" method="GET">
    <div class="table-list">
    <table width="100%" cellspacing="0">
      <thead>
        <tr>
          <th align="right" width="120">统计</th>
          <th align="center">日报表(个)</th>
          <th align="center">周报表(个)</th>
          <th align="center">月报表(个)</th>
          <th align="center">总数</th>
          
        </tr>
      </thead>
      <tbody  id="list">

          <tr >
          	<td align="right">电话量：</td>
            <td align="center">{$info.dayCount}</td>
            <td align="center">{$info.weekCount}</td>
            <td align="center">{$info.monthCount}</td>
            <td align="center">{$info.total}</td>
          </tr>
        
      </tbody>
    </table>
    <div class="btn">
      <div id="pages">{$page}</div>
    
       </div>
  </form>
</div>
</body>
</html>
<script type="text/javascript">
$(function(){
	var roleId = "{$Think.get.roleId}";
	var userId = "{$Think.get.userId}";
	$("#roleId").val(roleId);
	$("#userId").val(userId);
	if( roleId==0){
		$("#userId").hide();
	}
	
	$('#myform').ajaxForm({
		beforeSubmit:  checkForm,
		success:       complete,
		dataType: 'json'
	});
	function checkForm(){
		var len = $("input[name='spaceid[]']:checked").length;
		if(len < 1){
			msg('请先选择删除项！','warning',3);
			return false;
		}
	}
	var origin = $.artDialog.open.origin;
	function complete(data){
		msg(data.info,data.data);
		if(data.status) setTimeout(function(){origin.location.reload();},1500);
	}
	
	$('#roleId').live('change', function() {
		var roleId = $("#roleId option:selected").val();
		var href='__APP__/Admin/jsonUserList/randNum/'+Math.random();
		$("#userId").empty();
		if( roleId==0){
			$("#userId").hide();
		}else{
			$("#userId").show();
		}
		jQuery.ajax({ 
			type:'GET', 
			url:href, 
			dataType:'text', 
			data:encodeURI('roleId='+roleId),
			success:function(data){
				var jsondata = eval("("+ data+")");
				var arrLength = jsondata.data.length;
				jQuery("#userId").append("<option value=\"0\">请选择用户</option>");
				for(var i=0; i<arrLength; i++){
					jQuery("#userId").append("<option value=\""+jsondata.data[i]['id']+"\">"+jsondata.data[i]['username']+"</option>");
				}
			} 
		});
	});

})


	

</script>